package top.lixunda.ecommerce.server.good.api.entity.db;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 订单事件表
 * </p>
 *
 * @author Xumda
 * @since 2020-03-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("order_apply")
@ApiModel(value = "OrderApplyDO对象", description = "订单事件表")
public class OrderApplyDO extends Model<OrderApplyDO> {

    private static final long serialVersionUID=1L;

    /**
     * 退款申请
     */
    public static final String EVENT_TYPE_REFUND = "REFUND";

    /**
     * 是否处理？ 0 未处理 1 已处理
     */
    public static final Integer DEAL_FLAG_NOT_DEAL = 0;
    public static final Integer DEAL_FLAG_DEAL = 1;

    /**
     * 是否取消？ 0 未取消 1 已取消
     */
    public static final Integer CANCEL_FLAG_TRUE = 1;
    public static final Integer CANCEL_FLAG_FALSE = 0;

    public static final Integer FLAG_TRUE = 1;
    public static final Integer FLAG_FALSE = 0;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "订单id")
    @TableField("order_id")
    private Integer orderId;

    @ApiModelProperty(value = "事件类型")
    @TableField("event_type")
    private String eventType;

    @ApiModelProperty(value = "申请理由")
    @TableField("message")
    private String message;

    @ApiModelProperty(value = "创建人id")
    @TableField("create_user_id")
    private Integer createUserId;

    @ApiModelProperty(value = "创建人名称")
    @TableField("create_user_name")
    private String createUserName;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "该事件是否已经处理， 1 是 已经处理  0 否 没有处理")
    @TableField("deal_flag")
    private Integer dealFlag;

    @ApiModelProperty(value = "处理时间")
    @TableField("deal_time")
    private LocalDateTime dealTime;

    @ApiModelProperty(value = "处理人员id")
    @TableField("deal_id")
    private Integer dealId;

    @ApiModelProperty(value = "处理人员名称")
    @TableField("deal_name")
    private String dealName;

    @ApiModelProperty(value = "处理备注")
    @TableField("remark")
    private String remark;

    @ApiModelProperty(value = "是否取消，这里的取消是用户主动取消")
    @TableField("cancel_flag")
    private Integer cancelFlag;

    @JsonIgnore
    @TableLogic
    @ApiModelProperty(value = "逻辑删除， 1 已经删除  0 未删除")
    @TableField("flag")
    private Integer flag;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
